Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deflake limitrange singleflight test #113736

Merged
merged 1 commit into from Nov 8, 2022

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Nov 8, 2022

What type of PR is this?

/kind flake

What this PR does / why we need it:

Deflakes the limit range test in case of slow CI

Alternative to #113378

Which issue(s) this PR fixes:

Fixes #113377

NONE

/cc @aojea @aimuz

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Nov 8, 2022
@k8s-ci-robot k8s-ci-robot added kind/flake Categorizes issue or PR as related to a flaky test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 8, 2022
@k8s-ci-robot
Copy link
Contributor

@liggitt: GitHub didn't allow me to request PR reviews from the following users: aimuz.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

What type of PR is this?

/kind flake

What this PR does / why we need it:

Deflakes the limit range test in case of slow CI

Which issue(s) this PR fixes:

Fixes #113377

NONE

/cc @aojea @aimuz

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 8, 2022
@k8s-ci-robot
Copy link
Contributor

@liggitt: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Nov 8, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2022
@liggitt
Copy link
Member Author

liggitt commented Nov 8, 2022

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 8, 2022
// he always blocking before sending the signal
<-unhold
// make the handler slow so concurrent calls exercise the singleflight
time.Sleep(time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has to be always higher than the time it takes to create the goroutines and hit the group

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, if it is not higher, the ones that missed the singleflight hit the cache, and the test still passes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the concurrency pattern we want to implement is the one provided by sync.Cond, so we put all goroutines go to sleep here and we wake them up later ... but this approach is easier to read and in my local tests it seems very reliable

7m40s: 7249 runs so far, 0 failures
7m45s: 7344 runs so far, 0 failures
7m50s: 7440 runs so far, 0 failures
7m55s: 7488 runs so far, 0 failures
8m0s: 7584 runs so far, 0 failures
8m5s: 7680 runs so far, 0 failures
8m10s: 7728 runs so far, 0 failures
8m15s: 7824 runs so far, 0 failures
8m20s: 7920 runs so far, 0 failures
8m25s: 7968 runs so far, 0 failures
8m30s: 8064 runs so far, 0 failures
8m35s: 8157 runs so far, 0 failures
8m40s: 8208 runs so far, 0 failures
```

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2022
@aojea
Copy link
Member

aojea commented Nov 8, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit c36127e into kubernetes:master Nov 8, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Nov 8, 2022
@liggitt liggitt deleted the deflake-limit-range branch November 26, 2022 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestLimitRanger_GetLimitRangesFixed22422 flakes
3 participants